package emt.friendtracking.smsmodule;

import emt.friendtracking.BaseActivity;
import emt.friendtracking.IService;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BootReceiver extends BroadcastReceiver implements IService
{
	private static final String TAG = BootReceiver.class.getSimpleName();

	@Override
	public void onReceive(Context context, Intent intent) 
	{ 
		if(BaseActivity.prefs.getBoolean("autostart", true))
			if(BaseActivity.ServiceActivated(this))
			{
				context.startService(new Intent(context, SmsReceiverService.class));
				Log.d(TAG, "Service Started."); //TODO "Service Started."
			}
		Log.d(TAG, "onReceived."); //TODO "onReceived."
	}

	@Override
	public boolean isActive()
	{
		return true;
	}

}
